import React from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { addCount } from './store/actions/count'

const App = () => {
  const { count } = useSelector((state) => state.count)
  const dispatch = useDispatch()
  return (
    <div>
      <p>计数器：{count}</p>
      <button onClick={() => dispatch(addCount())}>+1</button>
    </div>
  )
}

export default App
